<template>
    <div id="test">{{text | dataFilter}}</div>
    
</template>

<script>
export default {
    data() {
        return {
            text: new Date(),
        
        }
    },
     filters: {
         dataFilter(val) {  //过滤器
             let date = new Date(val);
             return date.getFullYear() + '-' + (date.getMonth() + 1) + '-' + date.getDate();
         }
     },
     mounted() {
         console.log(1111);
         console.log(this);
     }
}
</script>

<style>
    @import './style/index.css'
</style>
